<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr XMLNS:MSHelp = "http://msdn.microsoft.com/mshelp" xmlns:ddue = 
"http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink = 
"http://www.w3.org/1999/xlink" xmlns:tool = "http://www.microsoft.com/tooltip"
XMLNS:[default] http://ddue.schemas.microsoft.com/authoring/2003/5 =
"http://ddue.schemas.microsoft.com/authoring/2003/5"><HEAD>
  <TITLE>Windows Azure Service Bus Simple Silverlight Sample</TITLE>
  <META content="text/html; CHARSET=utf-8" http-equiv=Content-Type></META>
  <META name=save content=history></META>
  <LINK rel=stylesheet type=text/css
  href="../CommonFiles/Classic.css"></LINK>

  <META name=GENERATOR content="MSHTML 8.00.6001.18783">
    <style type="text/css">
      .style2 {
      font-family: monospace;
      font-size: small;
      color: #000000;
      }
      </style>
  </HEAD>
<BODY>
  <DIV id=header>
    <TABLE id=topTable width="100%">
      <TBODY>
        <TR id=headerTableRow1>
          <TD align=left>
            <SPAN id=runningHeaderText></SPAN>
          </TD>
        </TR>
        <TR id=headerTableRow2>
          <TD align=left>
            <SPAN id=nsrTitle>Windows Azure Service Bus Simple Silverlight Sample</SPAN>
          </TD>
        </TR>
        <TR id=headerTableRow3>
          <TD></TD>
        </TR>
      </TBODY>
    </TABLE>
  </DIV>
  <DIV id=mainSection>
    <DIV id=mainBody>
        <p>
        This sample demonstrates how to use the Windows Azure Service Bus Messaging Features from Silverlight through the REST Service Bus endpoint.
        See the Service Bus documentation for more information about the Service Bus before exploring the samples.
        </p>
        <p>
        This sample demonstrates: Access Control Service token acquisition using a Service Identity's name and password; Namespace management operations including Queue creation and Queue deletion; Basic Messaging operations including Message Send and Message Receive (using Receive and Delete semantics).
        </p>
      <H2 class=heading>Prerequisites</H2>
      <DIV class=section>
        <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
          <P xmlns="">
            If you haven't already done so, please read the release notes
            document that explains how to sign up for a Windows Azure
            account and how to configure your environment.
          </P>
        </content>
      </DIV>
        <H2 class=heading>Sample Flow</H2>
      <DIV class=section>
        <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
            <p>
                The sample flows in the following manner:
                <ol>
                  <li>Get a WRAP Access Token from the Access Control Service for your namespace;</li>
                  <li>Create a new Queue on the Service Bus;</li>
	              <li>Send a plain text message to the newly created Queue;</li>
	              <li>Receive and Delete the message from the Queue;</li>
	              <li>Delete the Queue from the Service Bus.</li>
                </ol>
            </p>
          </content>
      </DIV>
        <H2 class=heading>Before You Run the Sample</H2>
      <DIV class=section>
        <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
              <p>
                To run the sample, you first need to have the <a href="http://go.microsoft.com/fwlink/?LinkID=177428">Silverlight 4 Tools for Visual Studio 2010</a> installed on your computer.
              </p>
              <p>
              In Silverlight, cross domain networking is restricted; any services you wish to call from a Silverlight application (including the Windows Azure Service Bus) are responsible for publishing a Client Access Policy file - you can learn more about <a href="http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx">Network Security Access Restrictions in Silverlight</a> on MSDN. This sample accesses network resources in two realms: firstly, an HTTP POST request is made to the Access Control Service; next HTTP POST, PUT and DELETE requests are made to the Service Bus. The Access Control Service publishes a default client access policy document which permits cross domain execution from all callers at the root of each namespace. The Service Bus, however, does not publish any policy by default; it is therefore necessary to upload a Client Access Policy document to the root of your service namespace - this can be done with the ClientAccessPolicyPublisher utility included with the samples. <b>You must ensure you have a Client Access Policy in place before running the sample or you will encounter Security Exceptions</b>.
              </p>
          </content>
      </DIV>
    <H2 class=heading>Running the Sample</H2>
    <DIV class=section>
      <content
xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">

        <P xmlns="">
          Start the sample application by clicking 'Start Debugging' on the 'Debug' menu in Visual Studio 2010. The application will open in your default browser. Follow the steps of the sample indicated by the user interface providing valid input at each stage.  
            <ol>
	          <li>
                <p>
	              Type your Service Namespace name (like 'contoso') and the issuer secret for the default service identity, owner (like 'Abcdefghijklmnopqrstuvwxyz01234567890aBCDEF=') then click the 'Get Token' button.
		        </p>
		        <p>
	              A request for an Access Control Service token is created and issued via HTTP POST. When the call returns successfully, the sample progresses to Step 2.
	            </p>
	          </li>
              <li>Type a name for a new Queue on the Service Bus - the name must be unique within your service namespace - and click the 'Create' button. A request to create the new queue is issued as an HTTP Put to the Service Bus using the authorization token gained in step 1.</li>
	          <li>Type some text to send as the body of a message and click the 'Send' button. A new message is enqueued by issuing a HTTP Post to the Service Bus using the authorization token gained in step 1.</li>
	          <li>Receive and Delete the message from the Queue by clicking the 'Receive' button - the text of the message which is received is displayed in the adjacent text box.</li>
	          <li>Delete the Queue from the Service Bus by clicking the 'Delete' button.</li>
            </ol>
        </P>
      </content>
    </DIV>
    <!--[if gte IE 5]><tool:tip avoidmouse="false" element="languageFilterToolTip"></tool:tip><![endif]-->
  </DIV>
    <hr />
    Did you find this information useful?
    <a href="http://go.microsoft.com/fwlink/?LinkID=155664">
      Please send your suggestions and comments about the documentation.
    </a>
  </DIV>
</BODY></HTML>
